// src/api/index.js

import axios from 'axios';
// 导入所有 s3.js 中导出的函数，并用 s3Api 对象接收
import * as s3Api from './s3';
import * as loggingApi from './logging';
import * as corsApi from './cors';

const apiClient = axios.create({
    baseURL: import.meta.env.VITE_API_BASE_URL || `http://${window.location.hostname}:8000`,
    withCredentials: true,
});

export default apiClient;

// 将所有API模块整合后统一导出，方便组件调用
export const api = {
    s3: s3Api,
    logging: loggingApi,
    cors: corsApi,
    // future modules...
    // user: userApi, 
};